package com.company.planner.entity;

import com.haulmont.chile.core.datatypes.impl.EnumClass;

import javax.annotation.Nullable;


public enum IndexState implements EnumClass<String> {

    OPEN("open"),
    CLOSE("close");

    private String id;

    IndexState(String value) {
        this.id = value;
    }

    public String getId() {
        return id;
    }

    @Nullable
    public static IndexState fromId(String id) {
        for (IndexState at : IndexState.values()) {
            if (at.getId().equals(id)) {
                return at;
            }
        }
        return null;
    }
}